package com.xxx.store.mapper;

import com.xxx.store.entity.Address;
import com.xxx.store.entity.District;

import java.util.Date;
import java.util.List;

public interface AddressMapper {
    /**
     * 插入用户收货地址
     * @param address 收货地址
     * @return
     */
    Integer insert(Address address);

    /**
     * 统计收货地址
     * @param uid
     * @return
     */
    Integer countByUid(Integer uid);

    /**
     * 查询用户地址信息
     * @param uid
     * @return
     */
    List<Address> findByUid(Integer uid);

    /**
     * 查找收货地址数据
     * @param aid
     * @return
     */
    Address findByAid(Integer aid);

    /**
     * 根据用户uid值修改用户收货地址
     * @param uid
     * @return
     */
    Integer updateNonDefault(Integer uid);

    /**
     *
     * @param aid
     * @return
     */
    Integer updateDefaultByAid(Integer aid, String modifiedUser, Date modifiedTime);

    Integer deleteByAid(Integer aid);
}
